/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


/**
 * One entry of the time constraint: what day, what start time, what end time.
 * @author yzhang
 */
public class TimePeriod {
    //public enum {Sun, Mon, Tue, Wed, Thu, Fri, Sat};
    public static final int SUN = 0;
    public static final int MON = 1;
    public static final int TUE = 2;
    public static final int WED = 3;
    public static final int THU = 4;
    public static final int FRI = 5;
    public static final int SAT = 6;

    public int day;
    public float startTime;  // between 0.0 - 24.0
    public float endTime;  // between 0.0 - 24.0

    public TimePeriod(int day, float startTime, float endTime) {
        this.day = day;
        this.startTime = startTime;
        this.endTime = endTime;
    }

    public boolean isColliding(TimePeriod tp) {
        return !(day != tp.day || endTime< tp.startTime || startTime > tp.endTime);
    }
}